<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8"/>
    <title>智能家居管理平台</title>
    <script src="../../js/jquery-3.2.1.js"></script>
    <link rel="stylesheet" href="../../css/bootstrap.min.new.css"/>
    <link rel="stylesheet" href="../../css/bootstrap-maizi.css"/>
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand">智能家居管理平台</a>
        </div>
        <!--导航-->
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li><a href="/userAdmin"><span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;用户管理</a></li>
                <li class="active"><a href="#"><span class="glyphicon glyphicon-list-alt"></span>&nbsp;&nbsp;设备管理</a>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">admin<span
                            class="caret"></span></a>
                </li>
                <li><a href="#"><span class="glyphicon glyphicon-off"></span>&nbsp;&nbsp;退出</a></li>
            </ul>
        </div>
    </div>
</nav>
<div class="container">
    <div class="row">
        <div class="col-md-2">
            <div class="list-group">
                <a href="#" class="list-group-item active">设备管理</a>
                <a href="/addset" class="list-group-item">添加设备</a>
                <a href="#" class="list-group-item">修改设备</a>
                <a href="#" class="list-group-item">删除设备</a>
            </div>
        </div>
        <div class="col-md-10">
            <div class="page-header">
                <h1>设备管理</h1>
            </div>
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#">设备列表</a>
                </li>
            </ul>
            <table class="table">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>设备名</th>
                    <th>设备连接类型</th>
                    <th>设备分类</th>
                </tr>
                </thead>
                <tbody id="contentView">

                </tbody>
            </table>
        </div>
    </div>
</div>

<script>
    $.ajax({
        url: "/q1",
        type: "get",
        success: function (data) {
            var htmlStr = "";
            for (var i = 0; i < data.length; i++) {
                var bean = data[i];
                var str = "<tr><td>" + bean.did + "</td><td>" + bean.dname + "</td><td>" + bean.connectType + "</td><td>" + bean.deviceCate + "</td></tr>"
                htmlStr += str;
            }
            $("#contentView").html(htmlStr);
        }
    });
</script>

<script src="../../js/jquery-3.2.1.js"></script>
<script src="../../js/bootstrap.min.js"></script>

</body>
</html>
